import { defineStore } from "pinia";
import { computed, ref } from 'vue'

export const useAppStore = defineStore(
    'test',
    () => {
        const num = ref(20)
        const addNum = () => {
            num.value += 1
        }
        const doubleNum = computed(() => num.value * 2)
        return {
            num,
            addNum,
            doubleNum
        }
    },
    {
        persist: {
            storage: localStorage,
            // paths: ['num']
        }
    }
)